﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using cmsservice.Entity;
using cmsservice.DAL;
/// <summary>
///TZZTKBLL 的摘要说明
/// </summary>
public class TZZTKBLL
{
	
    /// <summary>
    /// 投资主题库 TOP3输出 
    /// </summary>
    /// <returns></returns>
    public string GetTZZTKList()
    {
        TZZTKDAL dal = new TZZTKDAL();
        List<ZTTZK> list = dal.getZTTZKListDAL();
        string key = "typeId:" + "TZZTK";
        string str = (string)MemcachedTools.Get(key);

        var newList = new List<entity.NewsList>();
        foreach (var li in list)
        {
            var tmp = new entity.NewsList();
            tmp.Id = li.Id;
            tmp.Title = li.Title;
            tmp.PTime = li.PTime;
            newList.Add(tmp);
        }

        //输出对象
        //var zData = new NewsList_Lst { typename = "益盟点睛", typeid = code, list = newList };
        str = Newtonsoft.Json.JsonConvert.SerializeObject(newList);
        MemcachedTools.Add(key, str, DateTime.Now.AddHours(1));
        return str;
    }
	
}